<?php

namespace app\api\controller\cps;

use app\common\controller\Api;



/**
 * 饿了么联盟接口
 */
class Elm extends Api
{
    protected $noNeedLogin = ['order'];
    protected $noNeedRight = ['*'];


    //推广店铺列表
    public function shoplist()
    {
        try {
            //$page = input('page',1);
            $longitude = input('longitude','');
            $latitude = input('latitude','');

            $jd_model = new \app\api\model\cps\Elm();

            $res = $jd_model->shoplist($longitude,$latitude);
        }  catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('请求成功',$res);
    }

    //推广活动查询
    public function activity()
    {
        try {

            $activity_id = input('activity_id',0);
            $jd_model = new \app\api\model\cps\Elm();

            $res = $jd_model->activity($activity_id,$this->auth->id);
        }  catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('请求成功',$res);
    }

    //订单查询
    public function order()
    {
        try {

            $jd_model = new \app\api\model\cps\Elm();

            $res = $jd_model->order();
        }  catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('请求成功',$res);
    }
}